package pearson.automation.forms.note;

import org.openqa.selenium.By;

import framework.BaseForm;
import framework.elements.Button;
import framework.elements.Label;
import framework.elements.TextBox;

public class NewNoteForm extends BaseForm {

    private static Label notesDialog = new Label(By.xpath("//div[@data-popup-id='mark/create']"), "Notes");  
    
    private TextBox note   = new TextBox(By.id("title"), "Notes");
    private TextBox tags   = new TextBox(By.className("textboxlist-bit-editable-input"), "Tags");
    private Button  submit = new Button(By.xpath("//input[@type='submit']"), "Submit");
    
    public NewNoteForm() {
        super(notesDialog.getLocator(), "Notes");
    }

    public void setNote(String string) {
        note.setText(string);
    }

    public void setTags(String string) {
        tags.setText(string);
    }

    public void save() {
        submit.clickAndWait();
    }

}
